home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / FLUSHTST.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-24  |  1KB  |  44 lines

  1. {--------------------------------------------------------------}
  2. {                           FlushTest                          }
  3. {                                                              }
  4. {         Keyboard buffer flush demonstration program          }
  5. {                                                              }
  6. {                             by Jeff Duntemann                }
  7. {                             Turbo Pascal V5.0                }
  8. {                             Last update 7/1/88               }
  9. {                                                              }
  10. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  11. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  12. {--------------------------------------------------------------}
  13.  
  14.  
  15. PROGRAM FlushTest;
  16.  
  17. USES Crt,DOS;
  18.  
  19. VAR I,J : Integer;
  20.     Ch  : Char;
  21.  
  22. {$I FLUSHKEY.SRC}
  23.  
  24. PROCEDURE Counter;
  25.  
  26. BEGIN
  27.   FOR I := 1 TO 1000 DO
  28.     BEGIN
  29.       GotoXY(1,WhereY); ClrEol;
  30.       J := J + 1;
  31.       Write(J)
  32.     END;
  33.   Writeln
  34. END;
  35.  
  36. BEGIN
  37.   REPEAT
  38.     Counter;
  39.     FlushKey;
  40.     Write('End program now? (Y/N): ');
  41.     Readln(Ch);
  42.   UNTIL Ch IN ['Y','y']
  43. END.
  44.